package com.itc.bpm;


import com.itc.bpm.framework.quartz.DynamicQuartzScheduler;
import com.itc.common.config.config.MybatisPlusConfig;
import com.itc.common.security.annotation.EnableBaixunFeignClients;
import com.itc.common.security.annotation.EnableCustomConfig;
import com.itc.common.swagger.annotation.EnableCustomSwagger2;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.annotation.Resource;

/**
 * 流程调度模块
 */
@EnableCustomConfig
@EnableCustomSwagger2
@EnableBaixunFeignClients
@SpringBootApplication
@Import(value = {MybatisPlusConfig.class})
public class BpmApplication implements ApplicationRunner {

    @Resource
    private DynamicQuartzScheduler quartzUtil;
    public static void main(String[] args)
    {
        SpringApplication.run(BpmApplication.class, args);
        System.out.println("(♥◠‿◠)ﾉﾞ  ITC流程模块启动成功   ლ(´ڡ`ლ)ﾞ");
    }

    /**
     * 恢复停机定时任务
     * @param args incoming application arguments
     * @throws Exception
     */
    @Override
    public void run(ApplicationArguments args) throws Exception {
        quartzUtil.recoveryAllJob();
    }
}
